<template>
	<AppLayout>
		<view v-if="list.length">
			<view class="dir-top-nowrap">
				<view v-for="item in list" :key="item.id">
					<AppJumpButton url="/pages/article/info" :params="{ id: item.id }">
						<view>{{ item.title }}</view>
					</AppJumpButton>
				</view>
			</view>
		</view>
		<view v-else>没有数据</view>
	</AppLayout>
</template>

<script setup lang="ts">
import AppLayout from "@/components/AppLayout/index.vue";
import AppJumpButton from '@/components/AppJumpButton/index.vue';
import { api } from "@/api";
import { useLoadMore } from "@/hooks";
import { Article } from "@/types/service/article";

const { list, loadMore, refresh } = useLoadMore<Article>(api.article.getList)

onPullDownRefresh(() => {
	refresh()
})

onReachBottom(() => {
	loadMore()
})

</script>

<style scoped lang="scss">

</style>
